package cn.flexui.flexuiserver.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serial;

/**
 * <p>
 * 文件记录表
 * </p>
 *
 * @author apeto
 * @since 2024-09-21 08:42:27
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("file_detail")
@Schema(name = "FileDetail", description = "文件记录表")
public class FileDetail extends BaseEntity<FileDetail> {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "文件访问地址")
    @TableField("url")
    private String url;

    @Schema(description = "文件大小，单位字节")
    @TableField("size")
    private Long size;

    @Schema(description = "文件名称")
    @TableField("filename")
    private String filename;

    @Schema(description = "原始文件名")
    @TableField("original_filename")
    private String originalFilename;

    @Schema(description = "基础存储路径")
    @TableField("base_path")
    private String basePath;

    @Schema(description = "存储路径")
    @TableField("path")
    private String path;

    @Schema(description = "文件扩展名")
    @TableField("ext")
    private String ext;

    @Schema(description = "MIME类型")
    @TableField("content_type")
    private String contentType;

    @Schema(description = "存储平台")
    @TableField("platform")
    private String platform;

    @Schema(description = "缩略图访问路径")
    @TableField("th_url")
    private String thUrl;

    @Schema(description = "缩略图名称")
    @TableField("th_filename")
    private String thFilename;

    @Schema(description = "缩略图大小，单位字节")
    @TableField("th_size")
    private Long thSize;

    @Schema(description = "缩略图MIME类型")
    @TableField("th_content_type")
    private String thContentType;

    @Schema(description = "文件所属对象id")
    @TableField("object_id")
    private String objectId;

    @Schema(description = "文件所属对象类型，例如用户头像，评价图片")
    @TableField("object_type")
    private String objectType;

    @Schema(description = "文件元数据")
    @TableField("metadata")
    private String metadata;

    @Schema(description = "文件用户元数据")
    @TableField("user_metadata")
    private String userMetadata;

    @Schema(description = "缩略图元数据")
    @TableField("th_metadata")
    private String thMetadata;

    @Schema(description = "缩略图用户元数据")
    @TableField("th_user_metadata")
    private String thUserMetadata;

    @Schema(description = "附加属性")
    @TableField("attr")
    private String attr;

    @Schema(description = "文件ACL")
    @TableField("file_acl")
    private String fileAcl;

    @Schema(description = "缩略图文件ACL")
    @TableField("th_file_acl")
    private String thFileAcl;

    @Schema(description = "哈希信息")
    @TableField("hash_info")
    private String hashInfo;

    @Schema(description = "上传ID，仅在手动分片上传时使用")
    @TableField("upload_id")
    private String uploadId;

    @Schema(description = "上传状态，仅在手动分片上传时使用，1：初始化完成，2：上传完成")
    @TableField("upload_status")
    private Integer uploadStatus;
}
